package com.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author CHL
 * @ClassName: MyMvcConfig
 * @Description: 拦截器注册 - 配合拦截器使用
 * @date 2022/10/11 16:23
 * @Version 1.0
 */
@Configuration
public class MyMvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 添加拦截器 addPathPatterns、excludePathPatterns等属性设置需要拦截或需要排除的 URL, order执行顺序，值越小优先级越高
//        registry.addInterceptor(new ApiInterceptor()).addPathPatterns("/**").excludePathPatterns("/teacher/selectList").order(1);
//        registry.addInterceptor(new ApiInterceptor()).addPathPatterns("/**").excludePathPatterns("/teacher/selectList").order(2);

    }




}
